package com.sykj.cloud.common.log.service;

import com.sykj.cloud.system.api.RemoteLoggerService;
import com.sykj.cloud.system.api.domain.LogError;
import com.sykj.cloud.system.api.domain.LogUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * 异步调用日志服务
 *
 * @author ruoyi
 */
@Service
public class AsyncLogService
{
    @Autowired
    RemoteLoggerService loggerService;

    /**
     * 保存系统日志记录
     */
    @Async
    public void saveLogUser(LogUser logUser)
    {
        loggerService.add(logUser);
    }


    /**
     * 保存系统日志记录
     */
    @Async
    public void saveLogError(LogError logError)
    {
        loggerService.add(logError);
    }
}
